import React from 'react'
import classNames from 'classnames'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { type IconProps } from './types'

const Icon: React.FC<IconProps> = (props) => {
	// ico-primary
	const { className, theme, ...restProps } = props
	const classes = classNames('v-icon', className, {
		[`icon-${theme}`]: theme
	})

	return <FontAwesomeIcon className={classes} {...restProps}></FontAwesomeIcon>
}

export default Icon
